package Bloques;

import java.util.Random;
import event.*;


public class Intersection extends Segment {
	private Street[] outStreets = new Street[20];
	private Street[] inStreets = new Street[20];
	private int index = 0;
	
	public Intersection(int id, Event rootControl,boolean isPozo){
		super(id, rootControl,isPozo);
	}
	public void addIn(Street in){
		this.inStreets[index] = in;
		index++;
	}
	public void addOut(Street out){
		this.outStreets[index] = out;
		index++;
	}
	/*
	 * Estamos suponiendo el caso de studio.
	 *
	 */
	public Street randomOut()
	{
		Random generator = new Random();
		int randomIndex = generator.nextInt( 50);

		if(randomIndex <=25)
			return outStreets[0];
		else
			return outStreets[1];
	}
}
